Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Additional query methods
Use either the
modifyNewRecordmethod or thecollectChangesmethod to make changes to records.modifyNewRecord
The standard entry points for writing data validation are described in the business logic chapters in OpenEdge Development: Progress Dynamics Basic Development . However, there is an additional new entry point available to developers so that you can make changes to a newly created record before it is first displayed, normally to assign initial values. This is the
modifyNewRecordmethod. There is no standard code for this procedure, but it is runNO-ERRORduring record creation in the SDO. Therefore, any code you write for it in your SDO data logic procedure is executed at the proper time. It takes no parameters, but you can refer to the temp-table record buffer in the same way that you do for validation procedures, usingb_plus the name of the primary table for the SDO.Keep in mind that because
modifyNewRecordis executed only in the client-side SDO, it will not be effective for initializing a record using a WebSpeed front-end to the application.Here is a simple example for our
CustomerSDO, which initializes several of the fields assuming that theCustomeris from New Hampshire:
When you run the Customer Maintenance application window and select Add, you see the initial values shown in Figure 5–4.
Figure 5–4: Customer maintenance window
![]()
collectChanges
The
collectChangesnamed event is published automatically when a Save occurs. The event cascades down through any visual objects that contribute changes to the current record, such as multiple viewers with updateable fields from a single SDO.It takes two
INPUT-OUTPUTparameters that give each of these objects (viewers on different pages of a folder, for example) the opportunity to add their own changes and information about the changes to the growing list, passing it from procedure to procedure, as shown:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |